<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">数据中心
        </h3>
    </div>
    <div class="panel-body">
        <button class="btn btn-primary btn-lg" ng-disabled="type=='vote'" ng-click="changeType('vote')">投票数据</button>
        <button class="btn btn-primary btn-lg" ng-disabled="type=='prize'" ng-click="changeType('prize')">奖品数据</button>
        <button class="btn btn-primary btn-lg" ng-disabled="type=='follower'" ng-click="changeType('follower')">用户数据
        </button>
        <button class="btn btn-primary btn-lg" ng-disabled="type=='exchange'" ng-click="changeType('exchange')">中奖数据
        </button>
        <button class="btn btn-warning btn-lg" style="float: right" ng-click="export()">导出</button>
    </div>

    <table class="table table-striped table-bordered table-hover" ng-show="dataList.length>0">
        <thead>
        <tr ng-show="type=='vote'">
            <th>投票标题</th>
            <th>投票详情</th>
            <th>投票人数</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="data in dataList" ng-show="type=='vote'">
            <td ng-bind="data.title"></td>
            <td ng-bind="data.description"></td>
            <td ng-bind="data.amount"></td>
            <td>
                <button type="button" class="btn btn-primary btn-xs" ng-click="see(data.id)">查看</button>
            </td>
        </tr>

        <tr ng-show="type=='prize'">
            <th>奖品类型</th>
            <th>奖品详情</th>
            <th>奖品数量</th>
            <th>奖品剩余数量</th>
            <th>中奖几率</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="data in dataList" ng-show="type=='prize'">
            <td ng-bind="data.title"></td>
            <td ng-bind="data.description"></td>
            <td ng-bind="data.total"></td>
            <td ng-bind="data.unExchanged"></td>
            <td ng-bind="data.risk+'%'"></td>
        </tr>
        </tbody>

        <tbody>
        <tr ng-show="type=='follower'">
            <th>昵称</th>
            <th>性别</th>
            <th>国家</th>
            <th>省份</th>
            <th>城市</th>
            <th>关注时间</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="data in dataList" ng-show="type=='follower'">
            <td ng-bind="data.nickname"></td>
            <td ng-bind="data.sex"></td>
            <td ng-bind="data.country"></td>
            <td ng-bind="data.province"></td>
            <td ng-bind="data.city"></td>
            <td ng-bind="data.subscribeString"></td>
        </tr>
        </tbody>


        <tr ng-show="type=='exchange'">
            <th>奖品类型</th>
            <th>奖品详情</th>
            <th>奖品数量</th>
            <th>中奖几率</th>
            <th>中奖者微信名</th>
            <th>中奖者国家</th>
            <th>中奖者省份</th>
            <th>中奖者城市</th>
            <th>中奖者性别</th>
            <th>中奖者关注时间</th>
            <th>是否兑换</th>
            <th>中奖码</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="data in dataList" ng-show="type=='exchange'">
            <td ng-bind="data.prize.title"></td>
            <td ng-bind="data.prize.description"></td>
            <td ng-bind="data.prize.total"></td>
            <td ng-bind="data.prize.risk+'%'"></td>
            <td ng-bind="data.follower.nickname"></td>
            <td ng-bind="data.follower.country"></td>
            <td ng-bind="data.follower.province"></td>
            <td ng-bind="data.follower.city"></td>
            <td ng-bind="data.follower.sex"></td>
            <td ng-bind="data.follower.subscribeString"></td>
            <td ng-bind="data.hasGet | Exchange"></td>
            <td ng-bind="data.code"></td>
        </tr>
        </tbody>
    </table>
    <div ng-show="dataList.length==0" style="margin-top: 100px;"
         class="text-center ng-cloak" ng-cloak>
        <h1>暂时没有数据</h1>
    </div>
</div>

<div id="toast" ng-class="{'hidden':!successFlag}">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-icon-success-no-circle weui-icon_toast"></i>
        <p class="weui-toast__content">添加成功</p>
    </div>
</div>